package psd.model.Prolog.Converters;

import org.eclipse.jdt.core.dom.EnumDeclaration;

import psd.model.IConverter;
import psd.model.Prolog.FactGenerationToolbox;
import psd.model.Prolog.PrologConverter;


public class PrologEnumDeclarationConverter extends PrologConverter
implements IConverter<EnumDeclaration>{

	public PrologEnumDeclarationConverter(FactGenerationToolbox toolbox) {
		super(toolbox);
	}

	@Override
	public boolean convert(EnumDeclaration node) {
		visitAbstractTypeDeclaration(node, null, node.enumConstants());
        String superClass = idResolver.getJavaLangObjectID();
        String id = idResolver.getID(node);
        checkAndGenComments(node, id);
        writer.writeFact("extendsT", new String[] {
            id, superClass, this.getFilePath(node), this.getLineNumber(node)
        });
        checkAndGenComments(node, id);
        writer.writeFact("enumT", new String[] {
            id, this.getFilePath(node), this.getLineNumber(node)
        });
        return true;
	}

}
